<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>mtlb_colordef</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>M2SCI function</center>
    <div align="right">Last update : 08/06/2004</div>
    <p>
      <b>mtlb_colordef</b> - Matlab colordef emulation function</p>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>There is no Scilab equivalent function for Matlab <tt>
        <b>colordef</b>
      </tt> but there are equivalent instructions.</p>
    <p>
    The function <tt>
        <b>h = mtlb_colordef(color_option)</b>
      </tt> or 
    <tt>
        <b>h = mtlb_colordef(fig,color_option)</b>
      </tt> is used by
    <tt>
        <b>mfile2sci</b>
      </tt> to replace <tt>
        <b>colordef(color_option)</b>
      </tt> or 
    <tt>
        <b>colordef(fig,color_option)</b>
      </tt> when it was not
    possible to know what were the inputs while porting Matlab code to Scilab. This function will
    determine the correct semantic at run time. If you want to have a
    more efficient code it is possible to replace <tt>
        <b>mtlb_colordef</b>
      </tt> calls:
    </p>
    <dl>
      <dd>
        <b></b>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        When called with one input parameter, if <tt>
              <b>color_option</b>
            </tt> is equal to "black" or "none"
        <tt>
              <b>mtlb_colordef(color_option)</b>
            </tt> may be replaced by <tt>
              <b>fig = gcf();fig.background = -1;</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        When called with one input parameter, if <tt>
              <b>color_option</b>
            </tt> is equal to "white"
        <tt>
              <b>mtlb_colordef(color_option)</b>
            </tt> may be replaced by <tt>
              <b>fig = gcf();fig.background = -2;</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        When called with two input parameters, if <tt>
              <b>fig</b>
            </tt> is a graphic handle and 
	<tt>
              <b>color_option</b>
            </tt> is equal to "black" or "none"
        <tt>
              <b>mtlb_colordef(color_option)</b>
            </tt> may be replaced by <tt>
              <b>fig.background = -1;</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        When called with two input parameters, if <tt>
              <b>fig</b>
            </tt> is a graphic handle and 
	<tt>
              <b>color_option</b>
            </tt> is equal to "white"
        <tt>
              <b>mtlb_colordef(color_option)</b>
            </tt> may be replaced by <tt>
              <b>fig.background = -2;</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        When called with two input parameters, if <tt>
              <b>fig</b>
            </tt> is equal to "new" and
	<tt>
              <b>color_option</b>
            </tt> is equal to "black" or "none"
        <tt>
              <b>mtlb_colordef(color_option)</b>
            </tt> may be replaced by <tt>
              <b>fig = scf(max(winsid())+1);fig.background = -1;</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        When called with two input parameters, if <tt>
              <b>fig</b>
            </tt> is equal to "new" and
	<tt>
              <b>color_option</b>
            </tt> is equal to "white"
        <tt>
              <b>mtlb_colordef(color_option)</b>
            </tt> may be replaced by <tt>
              <b>fig = scf(max(winsid())+1);fig.background = -2;</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        When called with one output parameter <tt>
              <b>h</b>
            </tt>, just add <tt>
              <b>h = fig;</b>
            </tt> after equivalent instructions.
        </li>
        </dd>
      </dd>
    </dl>
    <p>Caution: <tt>
        <b>mtlb_colordef</b>
      </tt> has not to be used for hand coded functions.</p>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="../graphics/figure_properties.htm">
        <tt>
          <b>figure_properties</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
    <h3>
      <font color="blue">Authors</font>
    </h3>
    <dl>
      <dd>
        <b></b>V.C.</dd>
    </dl>
  </body>
</html>
